<Window xmlns:xom="clr-namespace:Xomega.Framework;assembly=Xomega.Framework"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:l="clr-namespace:AdventureWorks.Client.Objects;assembly=AdventureWorks.Client.Objects"
        x:Class="AdventureWorks.Client.WPF.EmployeeDetails"
        Title="Employee Details"
        Height="640"
        Width="640">
   <Grid Margin="10">
      <Grid.ColumnDefinitions>
         <ColumnDefinition Width="*"/>
      </Grid.ColumnDefinitions>
      <Grid.RowDefinitions>
         <RowDefinition Height="*"/>
         <RowDefinition Height="Auto"/>
      </Grid.RowDefinitions>
      <Button Grid.Row="1" Name="btnClose" HorizontalAlignment="Right"
              VerticalAlignment="Top"
              Width="75"
              Click="btnClose_Click">Close</Button>
      <Button Grid.Row="1" Name="btnSave" HorizontalAlignment="Right" VerticalAlignment="Top"
              Margin="0,0,90,0"
              Width="75"
              Click="btnSave_Click">Save</Button>
      <Grid Name="pnlMain">
         <Grid.RowDefinitions>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="Auto"/>
         </Grid.RowDefinitions>
         <Grid.ColumnDefinitions>
            <ColumnDefinition Width="Auto"/>
            <ColumnDefinition Width="*"/>
            <ColumnDefinition Width="Auto"/>
            <ColumnDefinition Width="*"/>
         </Grid.ColumnDefinitions>
         <Label Name="lblEmployeeId" Style="{StaticResource LabelStyle}" Grid.Row="0"
                Grid.Column="0">Employee Id:</Label>
         <TextBox Grid.Row="0" Grid.Column="1" Name="ctlEmployeeId"
                  xom:Property.Name="{x:Static l:EmployeeObject.EmployeeId}"
                  xom:Property.Label="{Binding ElementName=lblEmployeeId}"
                  Style="{StaticResource ControlStyle}"/>
         <Label Name="lblNationalIDNumber" Style="{StaticResource LabelStyle}" Grid.Row="1"
                Grid.Column="0">National ID Number:</Label>
         <TextBox Grid.Row="1" Grid.Column="1" Name="ctlNationalIDNumber"
                  xom:Property.Name="{x:Static l:EmployeeObject.NationalIDNumber}"
                  xom:Property.Label="{Binding ElementName=lblNationalIDNumber}"
                  Style="{StaticResource ControlStyle}"/>
         <Label Name="lblLogin" Style="{StaticResource LabelStyle}" Grid.Row="2"
                Grid.Column="0">Login:</Label>
         <TextBox Grid.Row="2" Grid.Column="1" Name="ctlLogin"
                  xom:Property.Name="{x:Static l:EmployeeObject.Login}"
                  xom:Property.Label="{Binding ElementName=lblLogin}"
                  Style="{StaticResource ControlStyle}"/>
         <Label Name="lblManager" Style="{StaticResource LabelStyle}" Grid.Row="3"
                Grid.Column="0">Manager:</Label>
         <TextBox Grid.Row="3" Grid.Column="1" Name="ctlManager"
                  xom:Property.Name="{x:Static l:EmployeeObject.Manager}"
                  xom:Property.Label="{Binding ElementName=lblManager}"
                  Style="{StaticResource ControlStyle}"/>
         <Label Name="lblTitle" Style="{StaticResource LabelStyle}" Grid.Row="4"
                Grid.Column="0">Title:</Label>
         <TextBox Grid.Row="4" Grid.Column="1" Name="ctlTitle"
                  xom:Property.Name="{x:Static l:EmployeeObject.Title}"
                  xom:Property.Label="{Binding ElementName=lblTitle}"
                  Style="{StaticResource ControlStyle}"/>
         <Label Name="lblBirthDate" Style="{StaticResource LabelStyle}" Grid.Row="5"
                Grid.Column="0">Birth Date:</Label>
         <TextBox Grid.Row="5" Grid.Column="1" Name="ctlBirthDate"
                  xom:Property.Name="{x:Static l:EmployeeObject.BirthDate}"
                  xom:Property.Label="{Binding ElementName=lblBirthDate}"
                  Style="{StaticResource ControlStyle}"/>
         <Label Name="lblMaritalStatus" Style="{StaticResource LabelStyle}" Grid.Row="6"
                Grid.Column="0">Marital Status:</Label>
         <ComboBox Grid.Row="6" Grid.Column="1" Name="ctlMaritalStatus"
                   xom:Property.Name="{x:Static l:EmployeeObject.MaritalStatus}"
                   xom:Property.Label="{Binding ElementName=lblMaritalStatus}"
                   Style="{StaticResource ControlStyle}"/>
         <Label Name="lblGender" Style="{StaticResource LabelStyle}" Grid.Row="7"
                Grid.Column="0">Gender:</Label>
         <ComboBox Grid.Row="7" Grid.Column="1" Name="ctlGender"
                   xom:Property.Name="{x:Static l:EmployeeObject.Gender}"
                   xom:Property.Label="{Binding ElementName=lblGender}"
                   Style="{StaticResource ControlStyle}"/>
         <Label Name="lblHireDate" Style="{StaticResource LabelStyle}" Grid.Row="8"
                Grid.Column="0">Hire Date:</Label>
         <TextBox Grid.Row="8" Grid.Column="1" Name="ctlHireDate"
                  xom:Property.Name="{x:Static l:EmployeeObject.HireDate}"
                  xom:Property.Label="{Binding ElementName=lblHireDate}"
                  Style="{StaticResource ControlStyle}"/>
         <Label Name="lblSalariedFlag" Style="{StaticResource LabelStyle}" Grid.Row="9"
                Grid.Column="0">Salaried Flag:</Label>
         <CheckBox Grid.Row="9" Grid.Column="1" Name="ctlSalariedFlag"
                   xom:Property.Name="{x:Static l:EmployeeObject.SalariedFlag}"
                   xom:Property.Label="{Binding ElementName=lblSalariedFlag}"
                   Style="{StaticResource ControlStyle}"/>
         <Label Name="lblVacationHours" Style="{StaticResource LabelStyle}" Grid.Row="0"
                Grid.Column="2">Vacation Hours:</Label>
         <TextBox Grid.Row="0" Grid.Column="3" Name="ctlVacationHours"
                  xom:Property.Name="{x:Static l:EmployeeObject.VacationHours}"
                  xom:Property.Label="{Binding ElementName=lblVacationHours}"
                  Style="{StaticResource ControlStyle}"/>
         <Label Name="lblSickLeaveHours" Style="{StaticResource LabelStyle}" Grid.Row="1"
                Grid.Column="2">Sick Leave Hours:</Label>
         <TextBox Grid.Row="1" Grid.Column="3" Name="ctlSickLeaveHours"
                  xom:Property.Name="{x:Static l:EmployeeObject.SickLeaveHours}"
                  xom:Property.Label="{Binding ElementName=lblSickLeaveHours}"
                  Style="{StaticResource ControlStyle}"/>
         <Label Name="lblCurrentFlag" Style="{StaticResource LabelStyle}" Grid.Row="2"
                Grid.Column="2">Current Flag:</Label>
         <CheckBox Grid.Row="2" Grid.Column="3" Name="ctlCurrentFlag"
                   xom:Property.Name="{x:Static l:EmployeeObject.CurrentFlag}"
                   xom:Property.Label="{Binding ElementName=lblCurrentFlag}"
                   Style="{StaticResource ControlStyle}"/>
         <Label Name="lblModifiedDate" Style="{StaticResource LabelStyle}" Grid.Row="3"
                Grid.Column="2">Modified Date:</Label>
         <TextBox Grid.Row="3" Grid.Column="3" Name="ctlModifiedDate"
                  xom:Property.Name="{x:Static l:EmployeeObject.ModifiedDate}"
                  xom:Property.Label="{Binding ElementName=lblModifiedDate}"
                  Style="{StaticResource ControlStyle}"/>
         <Label Name="lblFirstName" Style="{StaticResource LabelStyle}" Grid.Row="4"
                Grid.Column="2">First Name:</Label>
         <TextBox Grid.Row="4" Grid.Column="3" Name="ctlFirstName"
                  xom:Property.Name="{x:Static l:ContactObject.FirstName}"
                  xom:Property.ChildObject="{x:Static l:EmployeeObject.Contact}"
                  xom:Property.Label="{Binding ElementName=lblFirstName}"
                  Style="{StaticResource ControlStyle}"/>
         <Label Name="lblMiddleName" Style="{StaticResource LabelStyle}" Grid.Row="5"
                Grid.Column="2">Middle Name:</Label>
         <TextBox Grid.Row="5" Grid.Column="3" Name="ctlMiddleName"
                  xom:Property.Name="{x:Static l:ContactObject.MiddleName}"
                  xom:Property.ChildObject="{x:Static l:EmployeeObject.Contact}"
                  xom:Property.Label="{Binding ElementName=lblMiddleName}"
                  Style="{StaticResource ControlStyle}"/>
         <Label Name="lblLastName" Style="{StaticResource LabelStyle}" Grid.Row="6"
                Grid.Column="2">Last Name:</Label>
         <TextBox Grid.Row="6" Grid.Column="3" Name="ctlLastName"
                  xom:Property.Name="{x:Static l:ContactObject.LastName}"
                  xom:Property.ChildObject="{x:Static l:EmployeeObject.Contact}"
                  xom:Property.Label="{Binding ElementName=lblLastName}"
                  Style="{StaticResource ControlStyle}"/>
         <Label Name="lblEmailAddress" Style="{StaticResource LabelStyle}" Grid.Row="7"
                Grid.Column="2">Email Address:</Label>
         <TextBox Grid.Row="7" Grid.Column="3" Name="ctlEmailAddress"
                  xom:Property.Name="{x:Static l:ContactObject.EmailAddress}"
                  xom:Property.ChildObject="{x:Static l:EmployeeObject.Contact}"
                  xom:Property.Label="{Binding ElementName=lblEmailAddress}"
                  Style="{StaticResource ControlStyle}"/>
         <Label Name="lblPhone" Style="{StaticResource LabelStyle}" Grid.Row="8"
                Grid.Column="2">Phone:</Label>
         <TextBox Grid.Row="8" Grid.Column="3" Name="ctlPhone"
                  xom:Property.Name="{x:Static l:ContactObject.Phone}"
                  xom:Property.ChildObject="{x:Static l:EmployeeObject.Contact}"
                  xom:Property.Label="{Binding ElementName=lblPhone}"
                  Style="{StaticResource ControlStyle}"/>
         <Label Name="lblPayHistory" Grid.Row="10" Grid.ColumnSpan="4">Pay History:</Label>
         <ListView Grid.Row="11" Grid.ColumnSpan="4" Name="gridPayHistory">
            <ListView.View>
               <GridView>
                  <GridView.Columns>
                     <GridViewColumn Header="Pay Frequency">
                        <GridViewColumn.CellTemplate>
                           <DataTemplate>
                              <TextBlock xom:Property.Name="{x:Static l:EmployeePayHistory.PayFrequency}"/>
                           </DataTemplate>
                        </GridViewColumn.CellTemplate>
                     </GridViewColumn>
                     <GridViewColumn Header="Rate">
                        <GridViewColumn.CellTemplate>
                           <DataTemplate>
                              <TextBlock xom:Property.Name="{x:Static l:EmployeePayHistory.Rate}"/>
                           </DataTemplate>
                        </GridViewColumn.CellTemplate>
                     </GridViewColumn>
                     <GridViewColumn Header="Rate Change Date">
                        <GridViewColumn.CellTemplate>
                           <DataTemplate>
                              <TextBlock xom:Property.Name="{x:Static l:EmployeePayHistory.RateChangeDate}"/>
                           </DataTemplate>
                        </GridViewColumn.CellTemplate>
                     </GridViewColumn>
                  </GridView.Columns>
               </GridView>
            </ListView.View>
         </ListView>
      </Grid>
   </Grid>
</Window>